//
//  MyTeamViewCell.m
//  PosApp
//
//  Created by 刘萍 on 2018/9/12.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "MyTeamViewCell.h"

@implementation MyTeamViewCell

- (void)setModel:(MyTeamModel *)model{
    NSArray * titleArr = @[@"普通用户",@"合伙人",@"服务商",@"运营中心"];
    self.TeamName.text = [NSString stringWithFormat:@"%@",model.nickname];
    self.TeamiPhone.text = [NSString stringWithFormat:@"%@",model.username];
    self.TeamTime.text = [NSString stringWithFormat:@"%@",model.addtime];
    NSUInteger Num = [model.usergroup integerValue];
    self.TeamTypeLabel.text = [NSString stringWithFormat:@"%@",titleArr[Num-1]];
}

- (IBAction)ClickOnBtnToFZ:(id)sender {
    [MBProgressHUD showAlertViewWithText:@"复制成功"];
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    pasteboard.string = [NSString stringWithFormat:@"%@",self.TeamiPhone.text];
}

- (IBAction)ClickOnBtnToCalliPhone:(id)sender {
    
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",self.TeamiPhone.text]];
    //调用系统方法拨号
    [[UIApplication sharedApplication] openURL:url];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
